/**
 * @description: 区域信息
 */

import type { CommonAPI } from '../types/all'
import { defHttp } from '../http'

/** 批量设置标签 */
export const postManageHypervisorTagsBatchApi: CommonAPI<
  '/v1/manage/hypervisor/tags',
  'post'
> = data => defHttp.post(`/v1/manage/hypervisor/tags`, { data })

/** 计算节点列表 */
export const getManageHypervisorsListApi: CommonAPI<
  '/v1/manage/hypervisors',
  'get'
> = params => defHttp.get(`/v1/manage/hypervisors`, { params })

/** 计算节点列表 */
export const getManageHypervisorsSimpleListApi: CommonAPI<
  '/v1/manage/hypervisors/simple',
  'get'
> = params => defHttp.get(`/v1/manage/hypervisors/simple`, { params })

/** 新建区域 */
export const addManageRegionApi: CommonAPI<
  '/v1/manage/region',
  'post'
> = data => defHttp.post(`/v1/manage/region`, data)

/** 编辑区域 */
export const updateManageRegionByIdApi: CommonAPI<
  '/v1/manage/region/{id}',
  'put'
> = data => defHttp.put(`/v1/manage/region/${data.id}`, data)

/** 修改区域状态 */
export const updateManageRegionStatusByIdApi: CommonAPI<
  '/v1/manage/region/{id}/status',
  'put'
> = data => defHttp.put(`/v1/manage/region/${data.id}/status`, data)

/** 区域列表 */
export const getManageRegionsListApi: CommonAPI<
  '/v1/manage/regions',
  'get'
> = params => defHttp.get(`/v1/manage/regions`, { params })

/** 修改排序 */
export const updateManageRegionsIndexApi: CommonAPI<
  '/v1/manage/regions/index',
  'put'
> = data => defHttp.put(`/v1/manage/regions/index`, data)

/** 获取区域列表（简略信息用于筛选项等） */
export const getManageRegionsSimpleListApi: CommonAPI<
  '/v1/manage/regions/simple',
  'get'
> = params => defHttp.get(`/v1/manage/regions/simple`, { params })
